fix a clippy warning in glean/api/src/private/event.rs
Categories
(Developer Infrastructure :: Lint and Formatting, task)
Tracking
(firefox135 affected)
Tracking | Status | |
---|---|---|
firefox135 | --- | affected |
People
(Reporter: Sylvestre, Unassigned, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, leave-open, Whiteboard: [lang=rust])
Attachments
(3 files, 4 obsolete files)
Filling as a good first bug to learn workflows.
toolkit/components/glean/api/src/private/event.rs
110:29 warning use of `.unwrap_or_else(..)` to construct default value clippy::unwrap_or_else_default (clippy)
Links to the code:
https://searchfox.org/mozilla-central/rev/78a2c17cc80680a5a82446e4ce7c45a73b935383/toolkit/components/glean/api/src/private/event.rs#110
To run clippy:
./mach lint -l clippy toolkit/components/glean/api/src/ -W -v
As the change is trivial, it is just to learn how to contribute to Firefox.
Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html
Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.
Updated•1 year ago
|
Comment 2•1 year ago
|
||
Comment on attachment 9372689 [details]
Bug 1868296 - Fix clippy warnings. r=Sylvestre
Revision D198488 was moved to bug 1868293. Setting attachment 9372689 [details] to obsolete.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Backed out for causing build bustages
Backout link: https://hg.mozilla.org/integration/autoland/rev/377bd4a0d4f84e30283bc5ea1048330eb05e04f1
Failure log -> error: unused import: std::collections::HashMap
Comment 8•1 year ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:asthetiklee, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Reporter | ||
Comment 10•1 year ago
|
||
inactive, this is opened for a new contributor!
Comment 11•5 months ago
|
||
Replaced extra.unwrap_or_else(HashMap::new)
with extra.unwrap_or_default()
in EventMetric
implementation.
Aligns with Clippy's recommendation to use .unwrap_or_default()
for simplifying the default value logic.
Improves code readability and maintains idiomatic Rust style.
Updated•5 months ago
|
Comment 12•5 months ago
|
||
Comment 13•5 months ago
|
||
Simplify the handling of the extra
variable by combining the conversion and default assignment into a single if let
statement.
This reduces unnecessary variable assignments and makes the code more concise.
Comment 14•5 months ago
|
||
bugherder |
Comment 15•5 months ago
|
||
Reopened for unpublished changesets.
Updated•5 months ago
|
Updated•5 months ago
|
Comment 16•5 months ago
|
||
Comment 17•5 months ago
|
||
bugherder |
Updated•4 months ago
|
Comment 18•2 months ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.
Description
•